package com.zhanshen.controller;

import com.zhanshen.pojo.Find;
import com.zhanshen.pojo.Result;
import com.zhanshen.service.FindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.xml.ws.Response;

@Controller
public class FindController {

    @Autowired
    private FindService findService;
    @RequestMapping("speak")
    @ResponseBody
    public Result speak(Find find){
        int speak = findService.speak(find);
        if (speak==0){
            return Result.error(speak,"发言出错");
        }
        return Result.ok();
    }


    @RequestMapping("all")
    @ResponseBody
    public Result all(){
        findService.selectAll();
        System.out.println(findService.selectAll());
        return Result.ok(findService.selectAll());
    }


}
